﻿/*----------------------------------------------------------------
// 文件名：DaNoticeReceiver.cs
// 功能描述：类NoticeReceiver的数据访问层
//
// 
// 创建时间：2009-02-27
//
// 修改标识： 
// 修改描述： 
//----------------------------------------------------------------*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Globalization;
using System.Text;
using System.Xml;
using System.Data.Common;
using Microsoft.Practices.EnterpriseLibrary.Data;
using Microsoft.Practices.EnterpriseLibrary.Data.Sql;
using EQT.Model;

namespace EQT.Dal
{
    public partial class DaNoticeReceiver
    {
        public  int CreateNoticeReceive(MoNoticeReceiver modrec, DbTransaction trans)
        {
            string SQL_CreateNoticeReceive = "INSERT INTO Notice_Receiver (UID ,Notice_ID ,Rec_Status ,Rec_Time ) VALUES "
            + "(@Uid,@Notice_Id,@Rec_Status,@Rec_Time)";
            try
            {
                DbCommand dbCommand = db.GetSqlStringCommand(SQL_CreateNoticeReceive);
                //设置参数:Uid	
                db.AddInParameter(dbCommand, "Uid", DbType.AnsiString, modrec.Uid);
                //设置参数:Notice_Id	
                db.AddInParameter(dbCommand, "Notice_Id", DbType.AnsiString, modrec.NoticeId);
                //设置参数:Rec_Status	
                db.AddInParameter(dbCommand, "Rec_Status", DbType.Int32, modrec.RecStatus);
                //设置参数:Rec_Time	
                db.AddInParameter(dbCommand, "Rec_Time", DbType.DateTime, modrec.RecTime);

                return db.ExecuteNonQuery(dbCommand, trans);
            }
            catch (DbException ex)
            {
                HandleDbException(ex, modrec);
            }
            return 0;
        }
        
    }
}

